package com.qinggeng.project.system.domain;

import com.qinggeng.project.api.dto.OrdersGiftDto;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qinggeng.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import com.qinggeng.framework.web.domain.BaseEntity;

import java.util.Date;

/**
 * 订单礼品对象 orders_gift
 *
 * @author qinggeng
 * @date 2020-07-27
 */
@Data
public class OrdersGift {
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long ordersGiftId;

    /** 订单ID */
    @Excel(name = "订单ID")
    private Long ordersId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 礼品ID */
    @Excel(name = "礼品ID")
    private Long giftId;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String goodsName;

    /** 商品图片 */
    @Excel(name = "商品图片")
    private String goodsImg;

    /** 礼品类型  */
    @Excel(name = "礼品类型")
    private String giftType;

    /** 奖品数量 */
    @Excel(name = "奖品数量")
    private Long giftNum;

    /** 更新时间 */
    @Excel(name = "更新时间")
    private Date updateTime;

    /** 领取标志（10=未领取20=已领取） */
    @Excel(name = "领取标志（10=未领取20=已领取）")
    private String pickFlag;


    public Long getOrdersGiftId() {
        return ordersGiftId;
    }

    public void setOrdersGiftId(Long ordersGiftId) {
        this.ordersGiftId = ordersGiftId;
    }

    public Long getOrdersId() {
        return ordersId;
    }

    public void setOrdersId(Long ordersId) {
        this.ordersId = ordersId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getGiftId() {
        return giftId;
    }

    public void setGiftId(Long giftId) {
        this.giftId = giftId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsImg() {
        return goodsImg;
    }

    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
    }

    public String getGiftType() {
        return giftType;
    }

    public void setGiftType(String giftType) {
        this.giftType = giftType;
    }

    public Long getGiftNum() {
        return giftNum;
    }

    public void setGiftNum(Long giftNum) {
        this.giftNum = giftNum;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getPickFlag() {
        return pickFlag;
    }

    public void setPickFlag(String pickFlag) {
        this.pickFlag = pickFlag;
    }

    public OrdersGift() {
    }

    public OrdersGift(GoodsGift goodsGift, Long giftNum) {
        this.giftId = goodsGift.getGiftId();
        this.goodsName = goodsGift.getGiftName();
        this.goodsImg = goodsGift.getGiftImg();
        this.giftNum = giftNum;
    }

    public static OrdersGift news(OrdersGiftDto ordersGift, Long ordersId) {
        OrdersGift gift = new OrdersGift();
        gift.setOrdersId(ordersId);
        gift.setGoodsName(ordersGift.getGiftName());
        gift.setGoodsImg(ordersGift.getGiftImg());
        gift.setGiftId(ordersGift.getGiftId());
        return gift;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("ordersGiftId", getOrdersGiftId())
            .append("ordersId", getOrdersId())
            .append("giftId", getGiftId())
            .append("goodsName", getGoodsName())
            .append("goodsImg", getGoodsImg())
            .toString();
    }
}
